﻿@model GameSchool.Models.ViewModels.TeacherViewModels.TLevelViewModel

@Html.ActionLink("Búa til borð", "CreateLevel", new { CourseID = Model.CourseID})

@foreach (var lvl in Model.Levels)
{
    <div class="CreateLevel">
        <div class="Table">
            <img src="http://www.thefurniture.com/store/images/klaussner/dining/ashton-table.jpg" alt="Borð" />
        </div>

    <h3>@lvl.NumberInCourse. @lvl.Name</h3>
    
    <div class="CreateLevelSub">
        <h4>Próf</h4>
        <ul>
            @foreach (var test in Model.Tests)
            {
                if (test.LevelID == lvl.ID)
                {
                    <li>@Html.ActionLink(test.Name, "EditTest", new { theTestID = test.ID })</li>
                }
            }
        </ul>
        @Html.ActionLink("Búa til nýtt próf", "CreateTest", new { levelID = lvl.ID, courseID = lvl.CourseID })
    </div>

    <div class="CreateLevelSub">
        <h4>Verkefni</h4>
        <ul>
            @foreach (var verk in Model.Assignments)
            {
                if (verk.LevelID == lvl.ID)
                {
                    <li>@verk.Name</li>
                }
            }
        </ul>
        @Html.ActionLink("Búa til nýtt verkefni", "CreateAssignment", new { levelID = lvl.ID, courseID = lvl.CourseID })
    </div>

    <div class="CreateLevelSub">
        <h4>Fyrirlestrar</h4>
        <ul>
            @foreach (var lc in Model.Lectures)
            {
                if (lc.LevelID == lvl.ID)
                {
                    <li>@lc.Name</li>
                }
            }
        </ul>
        @Html.ActionLink("Búa til nýjan fyrirlestur", "CreateLecture", new{ levelID = lvl.ID, courseID = lvl.CourseID })    
    </div>
    </div>
}